﻿using System.ComponentModel;
using Tetris.Game.ControlsBase.Common;

namespace Tetris.Game.ControlsBase
{
    [ToolboxItem(true)]
    [Shape(true, ShapeType.I)]
    public class IShape : TetrisShapeBase
    {
        public IShape()
        {
            this.TetrisShapeType = ShapeType.I;
            Size = this.TetrisShapeType.GetShapeDefaultSize();
            TetrisShapeColor = this.TetrisShapeType.GetShapeColor();
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
        }

        protected override void PaintBlocks(Graphics g)
        {
            int blockSize = this.Size.Height >> 2;
            BlockSize = blockSize;
            int h = blockSize << 2;
            this.Size = new Size(blockSize, h);
            for (int i = 0; i < 4; i++)
            {
                PaintBlock(g, 0, i * blockSize, blockSize, blockSize);
            }
        }
    }
}
